﻿@using GgcmsCSharp.Controllers;
@{
    var categories=ViewBag.dataHelper.Categories();
}	<header id="header">      
        <div class="navbar navbar-inverse" role="banner">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    
                    <a class="navbar-brand" href="/">
                    	<h1><img src="@ViewBag.pageTmpl.stylePath/images/logo.png" alt="logo"></h1>
                    </a>
                    
                </div>
                <div class="collapse navbar-collapse">
                    <ul class="nav navbar-nav navbar-right">
						@foreach (var item in categories)
						{
                        if(item.subCategory.Count>0){
                        <li class="dropdown" data-id="@item.Id"><a href="@item.RedirectUrl">@item.CategoryName</a>
                            <ul role="menu" class="sub-menu">
                                @foreach (var sub in item.subCategory){
                                <li><a href="@sub.RedirectUrl">@sub.CategoryName</a></li>
                                }
                            </ul>
                        </li>
                        }else{
                        <li data-id="@item.Id"><a href="@item.RedirectUrl">@item.CategoryName</a></li>
                        }}
                    </ul>
                </div>
                <div class="search">
                    <form role="form">
                        <i class="fa fa-search"></i>
                        <div class="field-toggle">
                            <input type="text" class="search-form" autocomplete="off" placeholder="Search">
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </header>
    <!--/#header-->